package study01;

public class Java19_Interface {
    public static void main(String[] args) {
        Computer c = new Computer();
        Light l = new Light();
        Light l1 = new Light();
        c.usb1 = l;
        c.usb2 = l1;
        c.powerSupply();
    }
}

interface USBInterface {}

interface USBSupply extends USBInterface {
    public void powerSupply();
}

interface USBReceive extends USBInterface {
    public void powerReceive();
}

class Computer implements USBSupply {
    public USBReceive usb1;
    public USBReceive usb2;
    public void powerSupply() {
        System.out.println("电脑提供能源");
        usb1.powerReceive();
        usb2.powerReceive();
    }
}

class Light implements USBReceive {
    public  void powerReceive () {
        System.out.println("电灯接收能源");
    }
}

